package com.gylang.user.context.constant;

import com.gylang.commons.enmus.BaseDictEnum;
import com.gylang.commons.enmus.BaseNameEnum;
import com.gylang.commons.enmus.BaseTypeEnum;
import com.gylang.user.context.domain.RoleDTO;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author gylang
 * data 2020/9/2
 * @version v0.0.1
 */
@AllArgsConstructor
@Getter
public enum RoleTypeEnums implements BaseDictEnum, BaseTypeEnum, BaseNameEnum {
    /**
     * 角色类型
     */
    TOURIST("01", "tourist", "tourist", "游客"),
    COMMON_USER("02", "common_user", "member", "会员");
    private final String code;
    private final String value;
    private final String type;
    private final String name;

    public RoleDTO buildRole() {

        return RoleDTO.builder()
                .roleId(code)
                .roleName(name)
                .roleType(type)
                .value(value)
                .build();
    }
}
